import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ft_reader/beans/book_info_bean.dart';
import 'package:ft_reader/widgets/same_category_book_item.dart';

class SameCategoryBooksPage extends StatelessWidget {
  final List<SameCategoryBooks> sameCategoryBooks;

  SameCategoryBooksPage(this.sameCategoryBooks, {Key key}): super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text('同类型推荐'),
      ),
      body: ListView.separated(
          itemBuilder: (BuildContext context, int index) {
            return sameCategoryBookItem(context, index, sameCategoryBooks[index]);
          },
          separatorBuilder: (BuildContext context, int index) {
            return Divider(
              height: 2,
              color: Theme.of(context).primaryColor,
            );
          },
          itemCount: sameCategoryBooks.length
      ),
    );
  }

}